package createModel.singletonMode.threadLocalSigleton;

public class ClientTestThreadLocalSingletonTest {

    public static void main(String[] args) {
        for (int i = 0; i < 10; i++) {
            new Thread(() -> {
                TLocalSigleton instance = TLocalSigleton.getInstance();
                System.out.println(instance.hashCode());
            },
                       "线程" + i).start();
        }

        //ThreadLocal<User> local = new ThreadLocal<>();
        //for (int i = 0; i < 100000000000L; i++) {
        //    int finalI = i;
        //    new Thread(()->{
        //        User user = new User();
        //        user.setName("张三"+ finalI);
        //        local.set(user);
        //        System.out.println(Thread.currentThread().getName()+" ===="+local.get().getName());
        //        //local.remove();
        //        //System.out.println(Thread.currentThread().getName()+" ===="+local.get().getName());
        //    },"线程"+String.valueOf(i)).start();
    }


}
